Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip re-writing the same values to components, to satisfy bevy's change detection. #173

Merged
merged 8 commits into from
Oct 12, 2023

Conversation

RJ
Copy link
Contributor

@RJ RJ commented Oct 10, 2023

At the moment, a dynamic body (that isn't sleeping) with zero Linear and Angular velocity will still get its Position, Rotation, LinearVelocity, and AngularVelocity updated every tick (re-set to the same values).

This shows up if you use a Query<Entity, Changed<Position>> query filter, for example.

These commits guard against updating the components unless the value will actually change.

I noticed this while debugging some netcode that serializes and sends changed component values.

@RJ
Copy link
Contributor Author

RJ commented Oct 10, 2023

adds some verbosity, happy to make any style / naming changes or whatever you suggest.

@Jondolf Jondolf added the C-Enhancement New feature or request label Oct 10, 2023
Copy link
Owner

@Jondolf Jondolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments on style + an error in the velocity solver, otherwise this looks good!

RJ and others added 4 commits October 10, 2023 15:50
@Jondolf Jondolf merged commit a6af675 into Jondolf:main Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants